package com.dyson.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.dyson.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * @Author: Wy
 * @Email: DysonWy@foxMail.com
 * @Time: 2020/1/3 11:16
 * @Description:
 */
public interface UserMapper extends BaseMapper<User> {
    //注解方式
    @Select("select * from user ${ew.customSqlSegment}")
//${ew.customSqlSegment} 固定写法
    List<User> selectAll(@Param(Constants.WRAPPER) Wrapper<User> wrapper);

    //分页
    @Select("select * from user ${ew.customSqlSegment}")
    IPage<User> selectUserPage(IPage<User> page, @Param(Constants.WRAPPER) Wrapper<User> wrapper);
}
